package com.oms.app.news.action;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;

import com.oms.app.news.service.INewsService;

/**
 * 新闻相关业务
 * controller
 * @author wtj
 * @date Sep 2, 2012  6:25:26 PM
 */
@RequestMapping("")
public class NewsAction {

	private INewsService newsService;
	
	public void setNewsService(INewsService newsService) {
		this.newsService = newsService;
	}
	
	//绑定时间格式
	@InitBinder  
    protected void initBinder(WebDataBinder binder) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");   
        dateFormat.setLenient(false);
        binder.registerCustomEditor(Date.class,new CustomDateEditor(dateFormat, true));
    }
}